package com.briup.day12.bean;

public class Outer2 {
    private int o_num=10;
    private static int s_num=20;


    public static class Inner{
        private int i_num=40;
        private static int is_num=40;
        public static void sFun(){
//            System.out.println(Outer2.o_num);不能访问非静态
            System.out.println(s_num);
            System.out.println(Outer2.s_num);
        }
        public void show(){
            //不管是普通方法还是静态方法都不能访问外部非static成员
            System.out.println("内部非静态成员: "+this.i_num);
            System.out.println("内部静态成: "+Inner.is_num);
            System.out.println("外部静态"+s_num);

        }
    }
    //外部类可以访问静态内部类 可以访问所有成员和方法
    public void disp(){
        Outer2.Inner inner=new Outer2.Inner();
        System.out.println(inner.i_num);
//        System.out.println(Inner.i_num);
        System.out.println(Inner.is_num);
        System.out.println(inner.is_num);
        System.out.println("-----");
        inner.show();
        System.out.println("------");
        inner.sFun();

    }
}
